package org.orbis.tool;

public class Header{
	public static String getTitleBar(String name) {
		StringBuffer buf = new StringBuffer();
		
		buf.append("<div style=\"background:#4dac26; color:#ffffff;\">\n");
		buf.append("<h2> ");
		buf.append(name);
		buf.append(" </h2>\n");
		buf.append("</div>\n");
		
		return buf.toString();
	}
	
	public static String getHeader(int index) {
		StringBuffer buf = new StringBuffer();

		buf.append("<p style=\"margin: 10px;\">\n");

		buf.append("<span style=\"padding: 5px 15px 5px 15px; ");
		buf.append(index == 0? "color:#ffffff; background: #4dac26;": "background: #cccccc;");
		buf.append("\"> <a href=\"status\">Status</a> </span>\n");

		buf.append("<span style=\"padding: 5px 15px 5px 15px; ");
		buf.append(index == 1? "color:#ffffff; background: #4dac26;": "background: #ffffff;");
		buf.append("\"> <a href=\"index\">Index</a> </span>\n");
		
		buf.append("<span style=\"padding: 5px 15px 5px 15px; ");
		buf.append(index == 2? "color:#ffffff; background: #4dac26;": "background: #cccccc;");
		buf.append("\"> <a href=\"search\">Search</a> </span>\n");
		
		buf.append("<span style=\"padding: 5px 15px 5px 15px; ");
		buf.append(index == 3? "color:#ffffff; background: #4dac26;": "background: #ffffff;");
		buf.append("\"> <a href=\"delete\">Delete</a> </span>\n");
		
		buf.append("<span style=\"padding: 5px 15px 5px 15px; ");
		buf.append(index == 4? "color:#ffffff; background: #4dac26;": "background: #cccccc;");
		buf.append("\"> <a href=\"chop\">Chopper Test</a> </span>\n");
		
		buf.append("<span style=\"padding: 5px 15px 5px 15px; ");
		buf.append(index == 5? "color:#ffffff; background: #4dac26;": "background: #ffffff;");
		buf.append("\"> <a href=\"optimize\">Optimize</a> </span>\n");
		
		buf.append("<span style=\"padding: 5px 15px 5px 15px; ");
		buf.append(index == 6? "color:#ffffff; background: #4dac26;": "background: #cccccc;");
		buf.append("\"> <a href=\"terminate\">Terminate</a> </span>\n");
		
		buf.append("</p>\n");
		
		return buf.toString();
	}
}
